<!DOCTYPE html>
<html>
{include file="task/task_head"}
<body style="padding:10px;">
<div class="tplay-body-div">
    {include file="task/task_tab"}
    {include file="task/project_info"}

<!--    开发阶段-->
    {notempty name="devInfoList"}
    <div class="layui-form-item" style="float: left; margin-top:20px;">
        <div class="layui-input-inline">
            开发阶段：
        </div>

    </div>
    <table class="layui-table" lay-size="sm">
        {include file="task/thead"}
        <tbody>
        {volist name="devInfoList" id="devInfo"}
        <tr>
            <td>{$devInfo.task_id}</td>
            <td>{$taskTypeName[$devInfo.task_type]}</td>
            <td>{$devInfo.task_name}</td>
            <td>{$devInfo.begin_time|date="Y-m-d",###}</td>
            <td>{$devInfo.end_time|date="Y-m-d",###}</td>
            <td>{$devInfo.task_content}</td>
            <td>{$taskStatusMap[$devInfo.task_status]}</td>
            <td class="operation-menu">
                <div class="layui-btn-group">
                    <a href="{:url('admin/task/publish',['task_id'=>$devInfo.task_id,'project_id'=>$project_id])}" class="layui-btn layui-btn-xs a_menu layui-btn-primary" id="{$devInfo.task_id}" style="margin-right: 0;font-size:12px;"><i class="layui-icon"></i></a>
                    <a href="javascript:;" class="layui-btn layui-btn-xs layui-btn-primary delete" delete_id="{$devInfo.task_id}" style="margin-right: 0;font-size:12px;"><i class="layui-icon"></i></a>
                </div>

            </td>
        </tr>
        {/volist}
        </tbody>
    </table>
    {/notempty}

    <!--测试阶段-->
    {notempty name="testInfoList"}
    <div class="layui-form-item" style="float: left;">
        <div class="layui-input-inline">
            测试阶段：
        </div>

    </div>
    <table class="layui-table" lay-size="sm">
        {include file="task/thead"}
        <tbody>
        {volist name="testInfoList" id="testInfo"}
        <tr>
            <td>{$testInfo.task_id}</td>
            <td>{$taskTypeName[$testInfo.task_type]}</td>
            <td>{$testInfo.task_name}</td>
            <td>{$testInfo.begin_time|date="Y-m-d",###}</td>
            <td>{$testInfo.end_time|date="Y-m-d",###}</td>
            <td>{$testInfo.task_content}</td>
            <td>{$taskStatusMap[$testInfo.task_status]}</td>
            <td class="operation-menu">
                <div class="layui-btn-group">
                    <a href="{:url('admin/task/publish',['task_id'=>$testInfo.task_id,'project_id'=>$project_id])}" class="layui-btn layui-btn-xs a_menu layui-btn-primary" id="{$testInfo.task_id}" style="margin-right: 0;font-size:12px;"><i class="layui-icon"></i></a>
                    <a href="javascript:;" class="layui-btn layui-btn-xs layui-btn-primary delete" delete_id="{$testInfo.task_id}" style="margin-right: 0;font-size:12px;"><i class="layui-icon"></i></a>
                </div>
            </td>
        </tr>
        {/volist}
        </tbody>
    </table>
    {/notempty}

    <!--其他-->
    {notempty name="otherInfoList"}
    <div class="layui-form-item" style="float: left;">
        <div class="layui-input-inline">
            其他：
        </div>

    </div>
    <table class="layui-table" lay-size="sm">
        {include file="task/thead"}
        <tbody>
        {volist name="otherInfoList" id="otherInfo"}
        <tr>
            <td>{$otherInfo.task_id}</td>
            <td>{$taskTypeName[$otherInfo.task_type]}</td>
            <td>{$otherInfo.task_name}</td>
            <td>{$otherInfo.begin_time|date="Y-m-d",###}</td>
            <td>{$otherInfo.end_time|date="Y-m-d",###}</td>
            <td>{$otherInfo.task_content}</td>
            <td>{$taskStatusMap[$otherInfo.task_status]}</td>
            <td class="operation-menu">
                <div class="layui-btn-group">
                    <a href="{:url('admin/task/publish',['task_id'=>$otherInfo.task_id,'project_id'=>$project_id])}" class="layui-btn layui-btn-xs a_menu layui-btn-primary" id="{$otherInfo.task_id}" style="margin-right: 0;font-size:12px;"><i class="layui-icon"></i></a>
                    <a href="javascript:;" class="layui-btn layui-btn-xs layui-btn-primary delete" delete_id="{$otherInfo.task_id}" style="margin-right: 0;font-size:12px;"><i class="layui-icon"></i></a>
                </div>
            </td>
        </tr>
        {/volist}
        </tbody>
    </table>
    {/notempty}
    {include file="public/foot"}
    <script type="text/javascript">
        $('.delete').click(function(){
            var id = $(this).attr('delete_id');
            layer.confirm('确定要删除?', function (index) {
                $.ajax({
                    url: "{:url('admin/task/delete')}",
                    data: {id: id},
                    success: function (res) {
                        layer.msg(res.msg);
                        setTimeout(function () {
                            window.location.reload();
                        }, 1500)
                    },
                    error: function (err) {
                        console.error('err', err)
                    }
                })
            })
        })
    </script>
</div>
</body>
</html>
